﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Animal
    {
        private int leg;
        public int Leg
        {
            get { return this.leg; }
            set { this.leg = value; }
        }

        public void Walk()
        {
            Console.WriteLine("我会走路！");
        }
        public void Eat()
        {
            Console.WriteLine("我会吃！");
        }
        public void Sleep()
        {
            Console.WriteLine("我会睡觉！");
        }

        //虚方法
        public virtual void Cry()
        {
            Console.WriteLine("张开嘴，深呼吸，我要叫了");
        }
    }
}
